package controller;

import Service.ProService;
import Service.impl.ProServiceimpl;
import pojo.Pro;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * @author LiangHaiBo
 * @version 1.0
 * @date 2021.8.28 下午 15:23
 */
@javax.servlet.annotation.WebServlet("/delete")
public class DeletePro_Servlet extends HttpServlet {
    protected void doGet(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {
        Integer id =Integer.valueOf (request.getParameter("number"));
        ProService proService = new ProServiceimpl();

        proService.deleteGet(id);
        request.getRequestDispatcher("/findAllpro").forward(request,response);
        /*String pname = request.getParameter("id");

        int id = Integer.parseInt(pname);

        System.out.println(id);
        ProServiceimpl proServiceimpl = new ProServiceimpl();

        proServiceimpl.deleteGet(id);

        request.getRequestDispatcher("/findAllpro").forward(request,response);*/
    }
    protected void doPost(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {
        doGet(request,response);

    }
}
